home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_gen_simpledoor.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  90 lines

  1. # Jones 3D Cog Script
  2. #
  3. #
  4. # gen_SimpleDoor.cog
  5. #
  6. #
  7. # Hit the button, open the door. There's a break
  8. #
  9. #
  10. # (PAZ)
  11. #
  12. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  13. # ========================================================================================
  14.  
  15. symbols
  16.         message            startup
  17.         message         activated            
  18.          
  19.         thing           door
  20.         thing           button
  21.         thing            player                    local
  22.  
  23.         float           speed=0.5
  24.         
  25.         int             up=1                    local
  26.         
  27. end
  28.  
  29. #=================================================================================================
  30.  
  31. code
  32.  
  33. startup:
  34.  
  35.     player=GetLocalPlayerThing();
  36.     return;
  37.     
  38. #........................................................................................
  39.  
  40. activated:
  41.  
  42.         if (GetSourceRef() != player) return;
  43.  
  44.         if  (GetSenderRef() == button)
  45.         
  46.             {
  47.             
  48.             if (GetCurFrame(door) == 0)
  49.             
  50.                 {
  51.                 SetActorFlags(player, 0x200000);       
  52.                 SetExtCamOffset('1.0, 1.0, 1.0');
  53.                 Sleep(0.1);
  54.                 PlayMode(player, 60, 0);
  55.                 MoveToFrame(button, 1, speed);
  56.                 MoveToFrame(door, 1, speed);
  57.                 WaitForStop(door);
  58.                 MoveToFrame(button, 0, speed);
  59.                 RestoreExtCam();
  60.                 ClearActorFlags(player, 0x200000);
  61.                 return;
  62.                 }
  63.                     
  64.                 
  65.             if  (GetCurFrame(door) == 1)
  66.         
  67.                 {
  68.                 SetActorFlags(player, 0x200000);
  69.                 SetExtCamOffset('1.0, 1.0, 1.0');
  70.                 Sleep(0.1);
  71.                 PlayMode(player, 60, 0);
  72.                 MoveToFrame(button, 1, speed);
  73.                 MoveToFrame(door, 0, speed);
  74.                 WaitForStop(door);
  75.                 MoveToFrame(button, 0, speed);
  76.                 RestoreExtCam();
  77.                 ClearActorFlags(player, 0x200000);
  78.                 return;
  79.                 }
  80.  
  81.             }
  82.             
  83.             return;
  84.                 
  85.         
  86.         
  87.                                 
  88. end
  89.            
  90.